import java.util.Arrays;

public class ArraysTest2 {
    public static void main(String[] args) {
        int[] arr = {50, 10, 30, 20};

        //排序之前：[50, 10, 30, 20]
        System.out.println("排序之前：" + Arrays.toString(arr));

        //给数组排序
        Arrays.sort(arr);//按照从小到大排序

        //排序之后：[10, 20, 30, 50]
        System.out.println("排序之后：" + Arrays.toString(arr));
    }
}
